<template>
  <div>
    <baidu-map
      class="bm-view"
      :center="mapData"
      :zoom="mapZoom"
      :scroll-wheel-zoom="true"
      ak="baidu-ak">

      <bm-marker
        :position="{ lng: mapData.lng, lat: mapData.lat }"
        :dragging="false"
        :icon="icon">

<!--        <bm-label-->
<!--          :label-style="{ color: 'red', fontSize: '14px' }"-->
<!--          :offset="{ width: 20, height: -15 }"/>-->

        <bm-info-window
          :show="true">

          <div>告警类型:{{ mapData.alarmName }}</div>
          <div>定位时间:{{ mapData.alarmTime }}</div>
          <div>定位地址:{{ mapData.address }}</div>

          <slot></slot>
        </bm-info-window>

      </bm-marker>

    </baidu-map>
  </div>
</template>

<script>
export default {
  name: "WarnDialog",
  props:{
    mapData:{
      type:Object,
      default:()=>{}
    }
  },
  data(){
    return{
      icon: {
        url: process.env.VUE_APP_BASE_IMAGE_URL + 'carLocation/OffLine_90.png',
        //url: '/static/OffLine_90.png',
        size: {width: 52, height: 26},
        opts: {anchor: {width: 27, height: 13}},
      },
      mapZoom: 15,
    }
  }
}
</script>

<style scoped>

.bm-view {
  width: 100%;
  height: 380px;
}
</style>
